using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using XLCS.Standard;

namespace SqlCeViewer.Base
{
    public partial class BaseSubForm : DevExpress.XtraEditors.XtraForm,ISubForm
    {

        public delegate void UpdateClientInfoAfterModify();
        /// <summary>
        /// Update the main client info
        /// </summary>
        public UpdateClientInfoAfterModify Del_UpdateClientInfoAfterModify = null;

        public BaseSubForm()
        {
            InitializeComponent();

            FormBorderStyle = FormBorderStyle.FixedDialog;
            StartPosition = FormStartPosition.CenterScreen;
            Button but = new Button();
            but.Click += delegate { Dispose(); };
            CancelButton = but;

            X_SetDock();
            X_SetTitle();
            X_SetGridStyle();

            X_SetUILayout();
        }

        /// <summary>
        /// Alllow client to customize the UI relevant settings
        /// </summary>
        private void X_SetUILayout()
        {
            //ShowInTaskbar = false;

        }

        /// <summary>
        /// Alllow client to customize the datagridview style when override it 
        /// </summary>
        protected virtual void X_SetGridStyle()
        {

        }

        protected virtual void X_SetDock()
        {

        }

        protected virtual void X_SetTitle()
        {
            this.Text = "";
        }

        protected virtual void ShowDialogInTab()
        {
            X_SetUILayout();

            this.MdiParent = GlobalInfo.MainIDE.MyHost;
            
            Show();

        }

        private Form _hosterForm;

        public Form HosterForm
        {
            get
            {
                return _hosterForm;
            }
            set
            {
                _hosterForm = value;


            }
        }
    }
}